package com.longjianghuasheng.logistics.business.grab_an_order

import androidx.lifecycle.MutableLiveData
import com.longjianghuasheng.logistics.base.BaseMultiStateViewModel
import com.longjianghuasheng.logistics.data.model.bean.ApiResponseNoData
import com.longjianghuasheng.logistics.entity.DriverFormListItem
import com.longjianghuasheng.logistics.ext.commit2
import com.longjianghuasheng.logistics.network.apiService

class GrabASingleDetailsViewModel : BaseMultiStateViewModel() {
    var id = 0

    val result by lazy {
        MutableLiveData<DriverFormListItem>()
    }

    fun driver_form_show() {

        getData({ apiService.driver_form_show(id) }, result)
    }

    val notify by lazy {
        MutableLiveData<ApiResponseNoData>()
    }

    fun driver_do() {
        commit2({ apiService.driver_do(id) }, notify)
    }

}